package com.tree.common.config.i18n.controller;

import com.tree.common.config.i18n.util.MessageUtil;
import com.tree.mybatisplus.user.entity.User;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName com.demo.common.i18n.controller
 * Description: <类功能描述>. <br>
 * <p>
 * <使用说明>
 * </p>
 * @Author tree
 * @Date 2019-05-25 00:14
 * @Version 1.0
 */
@Api("国际化")
@RestController
@RequestMapping("/i18n")
public class I18nController {

    @GetMapping("/test")
    public String test(){
        return MessageUtil.getMessage("springboot.demo.name");
    }

    @GetMapping("/user")
    public User getUser(){
        User user = new User();
        user.setName(MessageUtil.getMessage("springboot.demo.name"));
        return user;
    }
}
